﻿using System;

namespace mst_regex
{
    public class OddlotStockPositions : StockPositionsBase<OddlotStockPosition>
    {
        public OddlotStockPositions() : this(StockExchangeType.Dse, DateTime.Today)
        {
        }

        public OddlotStockPositions(StockExchangeType exchange, DateTime date) : base(exchange, date)
        {
        }

        public void AddRecord(string symbol, decimal maxPrice, decimal minPrice,
                              decimal value, int trades, int quantity)
        {
            var record = new OddlotStockPosition
                             {
                                 Symbol = symbol.Trim().ToUpper(),
                                 Trades = trades,
                                 ValueInMillions = value,
                                 MaxPrice = maxPrice,
                                 MinPrice = minPrice,
                                 Quantity = quantity,
                                 EffectiveDate = EffectiveDate,
                                 StockExchange = StockExchange
                             };
            AddItem(symbol, record);
        }

        public string ToXml()
        {
            return ToXml<StockPosition>();
        }
    }
}